/*
 * Copyright 2006 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.maxMgmt;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.maxMgmt.Dao.InqDao;
import com.maxMgmt.Dto.DoctTypesDto;
import com.maxMgmt.Dto.InqTypesDto;
import com.maxMgmt.Dto.ProductsDto;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.conversion.annotations.Conversion;

/**
 * 
 */
@Conversion()
public class IndexAction extends ActionSupport {
    
    private static final long serialVersionUID = 1L;
    
	@Autowired
    private InqDao inqDao;
    private List<InqTypesDto> inqTypeList = new ArrayList<InqTypesDto>();
    private List<DoctTypesDto> doctTypeList = new ArrayList<DoctTypesDto>();
    private List<ProductsDto> productsList = new ArrayList<ProductsDto>();
        
    public String execute() throws Exception {
    	inqTypeList = inqDao.fetchInquiryList();
    	doctTypeList = inqDao.fetchDoctTypeList();
    	productsList = inqDao.fetchProductList();
        return SUCCESS;
    }

	public List<InqTypesDto> getInqTypeList() {
		return inqTypeList;
	}

	public void setInqTypeList(List<InqTypesDto> inqTypeList) {
		this.inqTypeList = inqTypeList;
	}

	public List<DoctTypesDto> getDoctTypeList() {
		return doctTypeList;
	}

	public void setDoctTypeList(List<DoctTypesDto> doctTypeList) {
		this.doctTypeList = doctTypeList;
	}

	public List<ProductsDto> getProductsList() {
		return productsList;
	}

	public void setProductsList(List<ProductsDto> productsList) {
		this.productsList = productsList;
	}
}
